<!DOCTYPE html>
<html lang="en" ng-app ="medicoApp">
<head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
	<title>Medico</title>
		<link rel="stylesheet" type="text/css" href="../../css/smart_icons_styles.css">
	  	<link rel="stylesheet" type="text/css" href="../../css/smart_menu.css">
	  	<link rel="stylesheet" type="text/css" href="../../css/smart_general.css">
	  	<link rel="stylesheet" type="text/css" href="../../css/smart_tabladatos.css">
	  	
	  	<link rel="stylesheet" type="text/css" href="../../js/ngdialog-0.2.3/ngDialog.css">
	  	<link rel="stylesheet" type="text/css" href="../../js/ngdialog-0.2.3/ngDialog-theme-default.css">
		<link rel="stylesheet" type="text/css" href="../../js/ngdialog-0.2.3/ngDialog-theme-plain.css">
	  	
        <!-- Importarmos angular JS -->
        <script src="../../js/jquery/jquery-1.8.3.min.js"></script>
    	<script type="text/javascript" src="../../js/main/template.js"></script>
    	<script src="../../js/angular-1.4.7/angular.min.js"></script>
    	<script src="../../js/ngdialog-0.2.3/ngDialog.min.js"></script> 
    	
    	<!-- importar script para las funciones del formulario -->
    	<script type="text/javascript" src="script/medico_app.js"></script>
    	<script type="text/javascript" src="script/medico_services.js"></script>
		<script type="text/javascript" src="script/medico_controller.js"></script>
		
</head>
<body ng-controller = "medicoCtrl">

 <div class="col-md-10" id="frame">
  <div class="panel panel-primary ng-scope">
   <div class="panel-heading">Medico
	  <a href="#"><span class="img"><img src="../../imagene/eliminar.png" style="float:right;"  ng-click="" title = "Eliminar medico"></span></a>
	  <a href="#"><span class="img"><img src="../../imagene/limpiar.png" style="float:right;"   ng-click="limpiarMedico()" title= "Limpiar formulario"></span></a>
	  <a href="#"><span class="img"><img src="../../imagene/consultar.png" style="float:right;" ng-click="consultarMedico()" title= "Consultar medico"></span></a>
	  <a href="#"><span class="img"><img src="../../imagene/guardar.png" style="float:right;"   ng-click="grabarMedico(persona,especilizacion,tipoServicioMaestro)" title= "Guardar medico"></span></a>
   </div>
   <div class="panel-body">
   
       <div class = "alert alert-danger alert-dismissable" id="messageBox">
       
            	<h4>{{titulo_mensajes}}</h4> {{descripcion_mensajes}}
            	<a href="#"><span class="imagen"><img src="../../imagene/bombilla-incandescente32.png"  ng-click="showModal()"></span></a>
            	
	   </div>
	   
	   <div class="col-md-10 panel panel-primary ng-scope"  style="height: 100%;">
	   
			<table style="width:100%; vertical-align: middle;">
				<tr style = "vertical-align: middle;">
					<td width="15%">
						<label  class="label" for="sctipo">Tipo</label><br>
					</td>
					<td width="15%">
						<label class="label" for="dsidentificacion">Identificación</label><br>	
					</td>
					<td width="15%">
						<label class="label" for="coRegistro">N° Registro</label><br>	
					</td>
				</tr>
				<tr style = "vertical-align: middle;">
					<td width="15%">
						<select style="width:90%;" id="sctipo" class="seleccion" ng-model="tipoDocumentoMaestro" ng-options="option.dsdatmaestro for option in tipos" ng-change="chage()">
						</select>
					</td>
					<td width="40%">
						<input id="dsidentificacion" type="text" ng-keydown="downPress($event)" ng-keypress="buscarEvent($event,persona)" placeholder="Ingrese Identificación" class="texto" ng-model="persona.dsidentificacion">
					    <img src="../../imagene/search12.png" ng-click="buscarPersona(persona)" title= "Buscar" style="width: 16px">
					</td>
					<td width="15%">
						<input id="coRegistro" type="text" ng-keypress="" placeholder="Ingrese N° Registro" class="texto" ng-model="medico.conumeroregistro">
					</td>
				</tr>
				<tr style = "vertical-align: middle;">
				   
				   <td width="30%">
						<label class="label" for="dsNombreMedico">Nombre</label><br>	
				   </td>
				   <td width="15%">
						<label class="label" for="sexo">Sexo</label><br>	
				   </td>
				   <td width="15%">
						<label class="label" for="feNacimiento">Fecha nacimiento</label>
				   </td>
				</tr>
				<tr style = "vertical-align: middle;">
				   
				   <td width="30%">
						<input id="dsNombreMedico" type="text" disabled="disabled" class="texto" ng-model="persona.dsnombreCompleto" style="width: 100%;">
				   </td>
				   <td width="15%">
						<input id="sexo" type="text" ng-keypress="" disabled="disabled" class="texto" ng-model="persona.dssexo">
				   </td>
				   <td width="15%">
						<input id="feNacimiento" type="text" disabled="disabled" class="texto" ng_model="persona.dsfechaNacimiento">
				   </td>
				</tr>
				<tr style = "vertical-align: middle;">
				   
				   <td width="15%">
						<label class="label" for="scTelefono">Teléfono</label><br>	
				   </td>
				   <td width="15%">
						<label class="label" for="coCelular">Celular</label><br>	
				   </td>
				   <td width="15%">
						<label class="label" for="dsDireccion">Direccion</label>
				   </td>
				    <td width="15%">
						<label class="label" for="dsemail">Email</label>
				   </td>
				</tr>
				<tr style = "vertical-align: middle;">
				   
				   <td width="15%">
						<input id="scTelefono" type="text" disabled="disabled" class="texto" ng-model="persona.dstelefono1" style="width: 50%;">
				   </td>
				   <td width="15%">
						<input id="coCelular" type="text" ng-keypress="" disabled="disabled" class="texto" ng-model="persona.dscelular">
				   </td>
				   <td width="15%">
						<input id="dsDireccion" type="text" disabled="disabled" class="texto" ng_model="persona.dsdireccion" style="width: 100%;">
				   </td>
				    <td width="15%">
						<input id="dsemail" type="text" disabled="disabled" class="texto" ng_model="persona.dsemail">
				   </td>
				</tr>
			</table>
	   </div>
	   
	   <div class="panel panel-primary ng-scope">
        <div class="panel-heading">información profesional</div>
	   </div>
	   
	   <div class="col-md-10 panel panel-primary ng-scope"  style="height: 80px;">
			<table style="width:50%; vertical-align: middle;">
				<tr style = "vertical-align: middle;">
					<td style="width:15%; vertical-align: middle;">
						<label for="scEspecializacion" class="label">Especialización</label><br/>
					</td>
					<td style="width:15%; vertical-align: middle;">
						<label for="scTipoServicio" class="label">Tipo servicio</label><br/>
					</td>
				</tr>
				<tr style = "vertical-align: middle;">
					<td style="width:15%; vertical-align: middle;">
						<select id="scEspecializacion" class="seleccion" ng-model="especilizacion" ng-options="option.dsespecialidad for option in especializacion" ng-change="chage()">
						</select>
					</td>
					<td style="width:15%; vertical-align: middle;">
						<select id="scTipoServicio" class="seleccion" ng-model="tipoServicioMaestro" ng-options="option.dsdatmaestro for option in tipoServicio" ng-change="chage()">
						</select>
					</td>
				</tr>
			</table>
	   </div>
	   
	   <div class="panel panel-primary ng-scope">
        <div class="panel-heading">Lista de medicos</div>
	   </div>
	   <div class="container">				
					<table class = "tabledatos" style="width: 100%;" >
							<thead style="width: 100%;" >
								<tr>
									<th style="width: 15%;" scope="col" >Identificación</th>
									<th style="width: 15%;" scope="col" >Nº de registro</th>
									 <th style="width: 30%;" scope="col" >Nombre</th>
									 <th style="width: 15%;" scope="col" >Sexo</th>
									 <th style="width: 15%;" scope="col" >Teléfono</th>
									 <th style="width: 15%;" scope="col" >Celular</th>
									 <th style="width: 20%;" scope="col" >Dirección</th>
									 <th style="width: 20%;" scope="col" >Email</th>
									 <th style="width: 5%;" scope="col" >Acción</th>
								</tr>
							</thead>
							<tbody class="tbody" style="width: 100%;" >
							
								<tr ng-show="medicos.length == 0">
									<th colspan="5" style="text-align:center;">
										No se encontraron medicos registrados
									</th>
								</tr>
							
								<tr ng-repeat="d in medicos | orderBy : 'conumeroregistro'">
									    
									    <td  style="display: none;">
										  {{d.scmedico}}
										</td>
									    <td  style="width: 15%;">
										  {{d.scpersona.dsidentificacion}}
										</td>
										<td style="width: 15%;">
										  {{d.conumeroregistro}}
										</td>
										 <td  style="width: 30%;">
										  {{d.scpersona.dsnombreCompleto}}
										</td>
										 <td  style="width: 15%;">
										  {{d.scpersona.dssexo}}
										</td>
										 <td  style="width: 15%;">
										  {{d.scpersona.dstelefono1}}
										</td>
										 <td  style="width: 15%;">
										  {{d.scpersona.dscelular}}
										</td>
										 <td style="width: 20%;">
										  {{d.scpersona.dsdireccion}}
										</td>
										 <td style="width: 20%;">
										  {{d.scpersona.dsemail}}
										</td>
									    
										<td class="botonera-table" style="width: 5%;">
										<a href="#"><span class="img"><img src="../../imagene/eliminar.png" style="float:center;" ng-click="eliminar(d)" title ="Eliminar"></span></a>
										</td>						
								</tr>
							</tbody>
						</table>
	 </div>
	   
   </div>	
  </div>
 </div>
</body>
</html>